const {main,toArr} = require('../main/main');

describe('main()', () => {
    
     it("将数字分割开并存入数组",function(){
         let number = 1234;
         let result = toArr(number);
         let expect_arr = (['1','2','3','4']);
        expect(result).toEqual(expect_arr);
     });

     it("return correct text",function(){
         let system_num = 1234;
         let input_num = 1234;
         let result = main(system_num,input_num);
         expect(result).toEqual('4A0B');
     });

     it("return correct text",function(){
        let system_num = 1234;
        let input_num = 4321;
        let result = main(system_num,input_num);
        expect(result).toEqual('0A4B');
     });

     it("return correct text",function(){
        let system_num = 1234;
        let input_num = 1243;
        let result = main(system_num,input_num);
        expect(result).toEqual('2A2B');
     });

     it("return correct text",function(){
        let system_num = 1234;
        let input_num = 2355;
        let result = main(system_num,input_num);
        expect(result).toEqual('0A2B');
     })
});